package com.itany.servlet;

import com.alibaba.fastjson.JSON;
import com.itany.util.ResponseResult;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * Author：汤小洋
 * Date：2022-11-14 13:52
 * Description：<描述>
 */
@WebServlet("/world")
public class WorldServlet extends HttpServlet {

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println(req.getParameter("username"));
        System.out.println(req.getParameter("password"));

        resp.setContentType("application/json;charset=utf8");
        PrintWriter out = resp.getWriter();


        out.print(JSON.toJSONString(ResponseResult.success("ok")));
        out.close();
    }
}
